<!--
 * @author: Kate-sy
 * @create: 2021-06-22 12:46 PM
 * @license: MIT
 * @lastAuthor: Kate-sy
 * @lastEditTime: 2021-06-30 19:51 PM
 * @desc: 
-->
<template>
  <div class="hot-wrap">
    <div
      class="hot-item"
      :key="item.article_id"
      v-for="item in data"
      @click="hotClick(item)"
    >
      <div class="time">
        <div class="time-left">
          <div class="anther">{{ item.nick_name }}</div>
          <div class="times">{{ item.updated_at }}</div>
        </div>
        <div class="time-right" :style="{ display: hottag }">
          <div class="tagitem" :key="ite" v-for="ite in item.tag">
            {{ ite }}
          </div>
        </div>
      </div>
      <div class="item-body">
        <div class="itdody-left">
          <div class="itbo-tile">{{ item.title }}</div>
          <div class="itdesc" v-html="item.describe"></div>
        </div>
        <div class="itbody-right">
          <img :src="item.pic" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Hot",
  props: {
    hottag: String,
    data: Array,
  },
  data() {
    return {
      i: "sdfsd",
    };
  },
  methods: {
    hotClick(data) {
      this.$router.push({
        path: "Detail",
        query: { da: data, id: data.article_id, quserid:data.user_id},
      });
      console.log(data.user_id);
    },
  },
  mounted() {},
};
</script>
<style lang="scss" scoped>
.hot-wrap {
  width: 100%;
  // background-color: #fff;
  .hot-item {
    padding: 0px 20px;
    border-bottom: 1px solid #f4f4f4;
    padding-bottom: 16px;
    padding-top: 15px;
    &:hover {
      background-color: #fafafa;
      cursor: pointer;
    }
    .time {
      @include flex(space-between, center);
      height: 22px;
      margin-bottom: 13px;
      .time-left {
        @include flex(none, center);
        .anther {
          width: 70px;
          @include onerow();
          border-right: 1px solid #e5e6eb;
          text-align: left;
          margin-right: 10px;
          @include font(13px, #4e5969);
        }
        .times {
          @include font(14px, #86909c);
        }
      }
      .time-right {
        @include flex(none, center);
        .tagitem {
          @include font(14px, #4e5969);
          padding: 2px 5px;
          background-color: #fafafa;
          margin-left: 8px;
          border-radius: 2px;
          &:hover {
            background-color: #e5e6eb;
            cursor: pointer;
          }
        }
      }
    }
    .item-body {
      @include flex(space-between);
      .itdody-left {
        text-align: left;
        flex: 1;
        .itbo-tile {
          @include font(18px, #1d2129, 700);
          margin-bottom: 13px;
        }
        .itdesc {
          @include font(14px, #4e5969);
          line-height: 22px;
          height: 41px;
          word-break: break-all;
          @include hidden(2);
        }
      }
      .itbody-right {
        width: 142px;
        height: 80px;
        margin-left: 4px;
        img {
          @extend .itbody-right;
        }
      }
    }
  }
}
@media screen and (max-width: 960px) {
  .item-body {
    .itdody-left {
      flex-grow: 1;
    }
  }
}
</style>